package com.imooc.news_manager_project.utils;

import org.springframework.stereotype.Component;

/**
 * @project: news_manager_project
 * @author: 13965
 * @date：2023/10/6 19:23
 * @description:
 */
@Component
public class KeyHandleUtil {

    private static final String KEY_NEWS_LIKE_PREFIX = "news_like_";
    private static final String KEY_COMMENTS_LIKE_PREFIX = "comments_like_";


    //	生成对应新闻数据点赞数据的的key值
    public static  String handleNewsLikeKey(String id){
        if(id!=null){
            return KEY_NEWS_LIKE_PREFIX + id;
        }else {
            return null;
        }
    }

    //	生成对应评论数据点赞数据的key值
    public static  String handleCommentsLikeKey(String id){
        if(id!=null){
            return KEY_COMMENTS_LIKE_PREFIX + id;
        }else {
            return null;
        }
    }

}
